<!-- 友情链接模块 -->
<template>
  <div class="tFriendsBox">
    <h1>友链申请格式
      <h3> 网站名称: Zanke博客</h3>
      <h3>网站地址: https://www.baidu.com </h3>
      <h3>网站描述: 百度你懂的</h3>
      <h3>网站logo: https://www.sg.com/1.png</h3>

    </h1>
    <el-row>
      <el-col :span="12" class="tf-item" v-for="(item,index) in friendslink" :key="'f'+index">
        <a :href="item.address" target="_blank">
          <img :src="item.logo?item.logo:'static/img/tou.jpg'" :onerror="$store.state.errorImg">
          <h4>{{ item.name }}</h4>
          <p>{{ item.description }}</p>
        </a>
      </el-col>
    </el-row>

    <div
      style="
          position: fixed;
          bottom: 10px;
          left: 50%;
          transform: translateX(-50%);
          z-index: 1000; /* 确保它不会被其他元素覆盖 */
          color: black; /* 背景颜色可以根据需要调整 */
          padding: 5px 10px;
          border-radius: 5px;
          box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); /* 添加阴影效果 */">
      <a href="https://beian.miit.gov.cn/" target="_blank" style="font-size: 12px; color: black; font-weight: bold">粤ICP备2024313408号-1</a>
    </div>
  </div>
</template>

<script>
import {getAllLink} from '../api/link.js'

export default {
  data() { //选项 / 数据
    return {
      friendslink: []//友情链接
    }
  },
  methods: { //事件处理器
    getList() {
      getAllLink().then((response) => {
        this.friendslink = response
      })
    }
  },
  components: { //定义组件

  },
  created() { //生命周期函数
    this.getList()
  }
}
</script>

<style>
.tFriendsBox {
  background: #fff;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 40px;
}

.tFriendsBox h1 {
  padding: 15px 0;
  font-size: 25px;
  font-weight: bold;
}

.tFriendsBox .tf-item {
  transition: all 0.3s ease-out;
  border-radius: 5px;
  position: relative;
}

.tFriendsBox .tf-item:hover {
  background: rgba(230, 244, 250, .5);
}

.tFriendsBox .tf-item a {
  display: block;
  padding: 0 10px 0 90px;
  height: 90px;
}

.tFriendsBox .tf-item a img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  position: absolute;
  top: 15px;
  left: 15px;
  cursor: pointer;
  object-fit: cover;
}

.tFriendsBox .tf-item a h4 {
  cursor: pointer;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  font-size: 20px;
  padding-top: 15px;
  font-weight: bold;
}

.tFriendsBox .tf-item a p {
  margin: 10px 0;
  font-size: 12px;
  line-height: 24px;
  color: #999;
  cursor: pointer;
  white-space: nowrap;
  text-overflow: ellipsis;
}
</style>
